Skip to content

Add the DCT reference fixtures and settle the pixel contract - #25

Merged
MPCoreDeveloper merged 1 commit into
mainfrom
docs/dct-fixtures
Nov 15, 2026
Merged

MPCoreDeveloper merged 1 commit into
mainfrom
docs/dct-fixtures

Conversation

@MPCoreDeveloper

Copy link
Copy Markdown
Owner

Summary

The first step of the DCTDecode slice: a reference to decode against, and the contract the decoder will honour.

  • tests/.../Assets/jpeg/jpeg-444.jpg — 16 x 16 RGB, quality 95, subsampling=0 (4:4:4, so chroma upsampling cannot mask a bug), written by Pillow 13.0.0; jpeg-444-expected.bin is the 768 bytes Pillow decodes from it (not the source pixels — JPEG is lossy).
  • jpeg-gray.jpg and jpeg-gray-expected.bin — the same bitmap as one component (256 bytes).
  • The test project copies Assets/**/*.jpg to the output.
  • ADR-005 records the contract: Data stays the stored JPEG bytes and DecodedPixels is filled from the new decoder, so a caller can have either. ImagePixels stops excluding DCTDecode once TryDecodeJpeg is wired, and the budget rules then apply.

Next

SOF0 (baseline) against these fixtures with a per-sample tolerance of 2; then SOF1/SOF2 with their own fixtures.

Evidence

No production code changed: dotnet build -c Release → 0 errors, dotnet test → 1242 passed, and the four fixtures are in the test output.

Two Pillow-written JPEGs (16 x 16 RGB at 4:4:4, and the same bitmap as one component) and the bytes Pillow
decodes from them are committed under Assets/jpeg, so the baseline DCT decoder starts from a reference
rather than a description. The test project copies Assets/**/*.jpg to the output.

ADR-005 records the contract the slice settles: Data stays the stored JPEG bytes and DecodedPixels is
filled from the new decoder, so a caller can have either. The baseline (SOF0) decoder is the next step,
against these fixtures and the 2-level tolerance.
@MPCoreDeveloper
MPCoreDeveloper merged commit 50f198d into main Nov 15, 2026
8 checks passed
@MPCoreDeveloper
MPCoreDeveloper deleted the docs/dct-fixtures branch November 15, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant